# -*- coding:UTF-8 -*-
import MySQLdb
import os
cxn = MySQLdb.connect(host='127.0.0.1', port=3307, user='root', passwd='860728', db='test')
# cxn.query('drop database t')

def checktable(cursor, tablename):
    cursor.execute('show tables like %s', [tablename])
    row = cursor.fetchone()
    if row:
        return True
    else :
        return False

def createtable(cursor, tablename):
    sql = 'create table %s like secure_sms_statisc' % tablename
    print sql
    cursor.execute(sql)
cursor = cxn.cursor();
if not checktable(cxn.cursor(), "secure_sms"):
    createtable(cursor, "secure_sms");
print str(None)
cursor.execute("SELECT GROUP_CONCAT(i),v FROM t")
row = cursor.fetchone()
print row[0]